{% extends "base.html" %}


{% block title %}Group directory{% endblock %}
{% block body_class %}{{ block.super }} groups group_list{% endblock %}


{% block content_title %}
  <h2>Group directory</h2>
{% endblock %}


{% block content %}
  {% if membership_list %}
    <h3>Memberships</h3>
    <div class="list">
      <ul>
        {% for group in membership_list %}
          <li><a href="{{ group.get_absolute_url }}">{{ group }}</a></li>
        {% endfor %}
      </ul>
    </div>
  {% endif %}

  {% if group_list %}
    <h3>All groups</h3>
    <div class="list">
      <ul>
        {% for group in group_list %}
          <li><a href="{{ group.get_absolute_url }}">{{ group }}</a></li>
        {% endfor %}
      </ul>
    </div>
  {% endif %}
  
  {% if user.is_authenticated %}
    <p><a class="button" href="{% url groups:create %}?next={{ request.path }}">Start a group</a></p>
  {% endif %}
{% endblock %}